%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Scripts to process wire-mesh, ultrasound and fieldbus data
% Autor: Carlos Amaral (ceamaral@hotmail.com)
% data: 06/10/2010
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %PROCESSING OF 2 WIREMESHS, TO USE IT IN ONLY ONE REPLACE THE FUNCTION
 %"gen_v_file_2x8x8_2wms(file)"
 
function main_carlos              

%max_distance_between_sensors_WM1_US1 = 0.400; % meters
distance_between_sensors_WM = 0.140; % meters
distance_between_sensors_US = 0.130; % meters
freq_aq_WM = 500;                   % Hz
freq_aq_US = 500;                   % Hz
tube_diameter = 0.026;               %tube diammeter (meters)

%lvm_processing % Calculates the mean values for JL and JG

% read_all_measurements('WM','2_channels',freq_aq_WM,tube_diameter); %read chanel void and watercut of each sensor
% read_all_measurements('US','2_channels',freq_aq_US,tube_diameter); %read chanel void and watercut of each sensor

%read_all_measurements_sync(freq_aq_US,tube_diameter);
 
% timeseries_hist_PSD('Measurements_list.txt','US','SYNC_DATA','void','channel_1',freq_aq_US,tube_diameter); %Plots Figures for ultrasound sensor 1
 timeseries_hist_PSD('ALL','WM','RAW_DATA','void','channel_1',freq_aq_US,tube_diameter); %Plots Figures for ultrasound sensor 1
% timeseries_hist_PSD('Measurements_list.txt','US','RAW_DATA','void','channel_1',freq_aq_US,tube_diameter); %Plots Figures for ultrasound sensor 1
% timeseries_hist_PSD('ALL','US','SYNC_DATA','midle_electrode_void','channel_2',freq_aq_US,tube_diameter); %Plots Figures for ultrasound sensor 1
% timeseries_hist_PSD('ALL','WM','SYNC_DATA','waterlevel','channel_2',freq_aq_US,tube_diameter); %Plots Figures for ultrasound sensor 1


 %velocity_general('Measurements_list.txt','WM','SYNC_DATA','void',distance_between_sensors_US,freq_aq_US,tube_diameter); %Plots Figures for ultrasound sensor 1
% measurement_list is the name of the TXT file with the list of measurements to be
% analyzed. For example: timeseries_hist_PSD('text_name.txt',...
% If measurement_list is 'ALL', processes all measurements
% data_type can be: 'US', analysis of ultrasound
%                   'WM', analysis of wire-mesh
% data_size can be: 'RAW_DATA', analysis of syncronization results
%                   'SYNC_DATA', analysis of syncronization results
% variable can be:  void
%                   midle_electrode_void
%                   waterlevel (however graphic is wrong)
% freq_aq in Hz
% tube_diameter in meters

return 